<%@page import="java.util.Collections"%>
<%@page import="com.neiquan.backstage.common.util.PinyinComparator"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.PlatformAllianceMember"%>
<%@page import="java.util.List"%>
<%@page import="com.neiquan.backstage.platform_alliance_member.PlatformAllianceMemberService"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
PlatformAllianceMemberService allianceMemberService = appCtx.getBean(PlatformAllianceMemberService.class);
List<PlatformAllianceMember> allianceMemberList = allianceMemberService.queryAllAllianceMember();
Map<String, List<PlatformAllianceMember>> map = new HashMap<String, List<PlatformAllianceMember>>();	// 区域名称:联盟成员列表
for (PlatformAllianceMember x : allianceMemberList) {
	if (!map.containsKey(x.getProvinceName())) {
		map.put(x.getProvinceName(), new ArrayList<PlatformAllianceMember>());
	}
	map.get(x.getProvinceName()).add(x);
}
List<String> sortedProvinceNameList = new ArrayList<String>(map.keySet());	// 已排序的区域名称列表
Collections.sort(sortedProvinceNameList, new PinyinComparator());
pageContext.setAttribute("sortedProvinceNameList", sortedProvinceNameList);
pageContext.setAttribute("map", map);
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>联盟成员列表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
</head>
<body bgcolor="#f0f0f0">
	<section>
		<c:forEach var="provinceName" items="${pageScope.sortedProvinceNameList}">
			<section class="mt">
				<p class="signup-title city pd">${provinceName}</p>
				<section class="city-line"></section>
				<c:forEach var="allianceMember" items="${pageScope.map[provinceName]}">
					<a href="platform_alliance_member_detail.jsp?id=${allianceMember.memberId}">
						<section class="apply common_bg">
							<section class="apply_left fl pd">
								<p class="apply_detail apply_detail_name">${allianceMember.name}</p>
								<time class="apply_time">${allianceMember.addr}</time>
							</section>
							<section class="fr">
								<a href="javascript:;" class="facilitate-right"></a>
							</section>
						</section>
					</a>
					<section class="line"></section>
				</c:forEach>
			</section>
		</c:forEach>
	</section>
</body>
<script src="js/responsive.js"></script>
</html>
